home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-02-22 | 52.3 KB | 2,297 lines |
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/Changelo,v
- retrieving revision 1.86
- diff -c -r1.86 Changelo
- *** 1.86 1992/12/28 07:52:43
- --- Changelo 1993/02/22 17:57:37
- ***************
- *** 3474,3476 ****
- --- 3474,3620 ----
- wait.h (WSTOPPED): use expected value
-
- ---------------------------- Patchlevel 86 ---------------------------
- +
- + _cmpsf2.s _divsf3.cpp _extends.cpp _mulsf3.cpp
- + _negsf2.s _normsf.cpp : olaf
- + completed impl of NaN and infinities, even for floats.
- + thanks olaf!
- +
- + atof.c, doprnt.c:: andreas
- + I have implemented improved floating point formatting/scanning
- + routines for the mc68881. They use the builtin packed decimal
- + format, which gives a precision of 17 decimal digits. Formatted and
- + rescanned numbers now give identical results, and enquire reports no
- + problems anymore.
- +
- + string.h:: ++jrb
- + add parens to shut up gcc.
- +
- + doprnt.c:: Howard Chu
- + The patch to doprnt makes it less vulnerable to crashing when handed
- + a large floating point value. (Took me a while to figure out why I was
- + crashing, around address 0x30303030! }-) Basically, my math routine
- + returned a value like 0x7ff12345 0x60000000 which is larger than INF
- + but less than NaN. The check I put in makes it print this range of
- + numbers as NaN or -NaN, which is what the Sun C library does.
- +
- + falcon.h: ++entropy
- + Protected against multiple #include's.
- +
- + string.h: ++entropy
- + Added some parens to appease gcc -Wall with gcc 2.3.1.
- +
- + getuid.c: ++boender@dutiws.twi.tudelft.nl, ++entropy
- + Only negative returns from Psetuid() and Psetgid() indicate
- + an error. Positive returns indicate success (the PID is
- + returned from the OS). Modified getuid() and setgid() accordingly.
- +
- + a64l.c: ++boender@dutiws.twi.tudelft.nl
- + NEW module for conversion between longs and base-64 ASCII strings.
- +
- + a64l.c: ++entropy
- + Use __PROTO, use compiler.h, etc.
- +
- + support.h: ++entropy
- + Added prototypes for a64l(), l64a().
- +
- + support.h: ++boender@dutiws.twi.tudelft.nl, ++entropy
- + Fixed prototype for link(). Removed protoype for isatty()
- + (it exists in unistd.h)
- +
- + limits.h: ++entropy
- + Added #define PASS_MAX 8.
- +
- + getpass.c: ++entropy
- + Fixed to use PASS_MAX, fixed off-by-one-error (was writing past end
- + of static buf, very bad news). Removed some small kludges.
- +
- + fflush.c: ++boender@dutiws.twi.tudelft.nl, ++entropy
- + Return EOF instead of 0 for files that aren't open.
- +
- + mincl: ++jrb
- + add new target for a64l.o
- +
- + alloca.s, bcopy.s: ++dsb@cs.duke.edu
- + RENAME to alloca.cpp, bcopy.cpp so we can do conditional compilation.
- +
- + alloca.cpp, bcopy.cpp, bzero.cpp: ++dsb
- + Changes for HSC.
- +
- + mincl:
- + Account for the name changes.
- +
- + compiler.h: ++dsb
- + Rearrange the __SOZOBONC__ #defines, fix a typo.
- +
- + ctime.c, fscanf.c, sscanf.c: ++dsb
- + Make compatible with HSC.
- +
- + compiler.h: ++hohmuth
- + define __TCC_GEMLIB__ when used with Pure/Turbo C
- +
- + aesbind.h, gemfast.h: ++hohmuth
- + Make it useable with Pure's GEM library. The special declarations
- + in aesbind.h check for __TCC_GEMLIB__. Improved compatibility with
- + Turbo's GEM declarations when __TCC_COMPAT__ is defined.
- +
- + osbind.h: ++hohmuth
- + Fix typos, add macros for sloppier type checking when used with
- + Pure C.
- +
- + strupr.c: ++hohmuth
- + NEW file: add library call strupr().
- +
- + string.h: ++hohmuth
- + Add declaration of strupr().
- +
- + mincl, lattice/mincl.lcc, purec/mintlib.prj, sozobon/makefile:
- + Add strupr.c.
- +
- + doprnt.c: ++Ulf_Moeller@hh2.maus.de
- + Fix up the ARG macro (which tends to produce wrong results with Pure
- + C (which uses a type conversion scheme within ?: that differs from
- + GCC)).
- +
- + regexp.c: ++hohmuth
- + Make it Turbo/PureC-proof.
- +
- + ctime.c: ++hohmuth
- +
- + falcon.h: ++hyc@hanauma.jpl.nasa.gov
- + Remove superfluous equals sign in enum declaration.
- +
- + fread.c: ++ulf
- + Fix return value for text mode.
- +
- + times.c, times.h: ++ulf
- + Use long return value instead of int. This allows larger values
- + and agrees with the SysV man page. Returns realtime since epoch
- + like sysV (rather than 0,1,-1 like bsd as it previously did)
- +
- + strlwr/strupr.c:: ++jrb
- + bulletproof a little.
- +
- + a64l.c: ++boender@dutiws.twi.tudelft.nl
- + Add to comments a note that prototypes are in support.h.
- +
- + getpass.c:
- + Read password from /dev/tty, instead of stdin, if MiNT is active.
- +
- + support.h:
- + Functions link(), symlink() now take "const char *" instead of
- + "char *" parmeters.
- +
- + access.c: ++boender, ++entropy
- + Use real, not effective, user id's for access() checks.
- + Fix so access() always returns success on existing files if real
- + user id is 0 (root), regardless of file mode.
- +
- + mintbind.h:
- + Add new GEMDOS functions (macros) Dgetcwd() and Salert().
- +
- + errno.h: ++boender
- + Define ENODEV as alias for EUKDEV/EUNDEV.
- +
- +
- + ---------------------------- Patchlevel 87 ---------------------------
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/PatchLev.h,v
- retrieving revision 1.62
- diff -c -r1.62 PatchLev.h
- *** 1.62 1992/12/28 07:52:46
- --- PatchLev.h 1993/02/17 23:57:55
- ***************
- *** 1,5 ****
-
- ! #define PatchLevel "86"
-
- /*
- *
- --- 1,5 ----
-
- ! #define PatchLevel "87"
-
- /*
- *
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/mincl,v
- retrieving revision 1.24
- diff -c -r1.24 mincl
- *** 1.24 1992/12/28 07:52:50
- --- mincl 1993/02/17 23:58:01
- ***************
- *** 34,42 ****
-
- #
- # other portable stuff
- ! PORT = alphasor.o abs.o catch.o dirent.o findfile.o ftw.o getpw.o \
- getlogin.o getopt.o getpass.o ident.o mktemp.o scandir.o strlwr.o \
- ! strrev.o regexp.o regsup.o textio.o random.o obstack.o \
- il.o ic.o iw.o ig.o ip.o frwbin.o
- #
- # the string library
- --- 34,42 ----
-
- #
- # other portable stuff
- ! PORT = a64l.o alphasor.o abs.o catch.o dirent.o findfile.o ftw.o getpw.o \
- getlogin.o getopt.o getpass.o ident.o mktemp.o scandir.o strlwr.o \
- ! strrev.o strupr.o regexp.o regsup.o textio.o random.o obstack.o \
- il.o ic.o iw.o ig.o ip.o frwbin.o
- #
- # the string library
- ***************
- *** 106,112 ****
-
-
- # other dependencies
- - bcopy.o : bcopy.s
- atof.o : flonum.h
-
- #
- --- 106,111 ----
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/times.c,v
- retrieving revision 1.3
- diff -c -r1.3 times.c
- *** 1.3 1990/03/09 03:28:00
- --- times.c 1993/02/17 23:58:04
- ***************
- *** 5,18 ****
- extern clock_t _sys_runtime;
- extern clock_t _child_runtime;
-
- ! int
- times(struct tms *buffer)
- {
- ! if (!buffer) return 1;
- ! buffer->tms_cutime = (time_t) (_child_runtime * HZ / CLK_TCK);
- ! buffer->tms_cstime = (time_t) 0;
- ! buffer->tms_stime = (time_t) (_sys_runtime * HZ / CLK_TCK);
- ! buffer->tms_utime = (time_t)
- ! ((clock() - _sys_runtime - _child_runtime) * HZ / CLK_TCK);
- ! return 0;
- }
- --- 5,22 ----
- extern clock_t _sys_runtime;
- extern clock_t _child_runtime;
-
- ! long
- times(struct tms *buffer)
- {
- ! long real_time = clock();
- !
- ! if (!buffer)
- ! return -1L;
- !
- ! buffer->tms_cutime = (time_t) (_child_runtime * HZ / CLK_TCK);
- ! buffer->tms_cstime = (time_t) 0;
- ! buffer->tms_stime = (time_t) (_sys_runtime * HZ / CLK_TCK);
- ! buffer->tms_utime = (time_t)
- ! ((real_time - _sys_runtime - _child_runtime) * HZ / CLK_TCK);
- ! return real_time;
- }
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_cmpsf2.s,v
- retrieving revision 1.3
- diff -c -r1.3 _cmpsf2.s
- *** 1.3 1992/10/09 20:35:29
- --- _cmpsf2.s 1993/01/13 14:30:36
- ***************
- *** 1,49 ****
- | single floating point compare routine
- |
- ! | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
- ! | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- |
- - |
- - | Revision 1.1, kub 12-89 :
- - | Created single float version for 68000
- - |
- - | Revision 1.0:
- - | original 8088 code from P.S.Housel for double floats
-
- .text
- .even
- .globl __cmpsf2, ___cmpsf2
- - | additional entry points for gcc2
- - .globl ___eqsf2, ___nesf2, ___gtsf2, ___gesf2, ___ltsf2, ___lesf2
-
- __cmpsf2:
- ___cmpsf2:
- ___eqsf2:
- ___nesf2:
- ___gtsf2:
- ! ___gesf2:
- ! ___ltsf2:
- ! ___lesf2:
- ! moveml sp@(4),d0-d1 | get u and v
- ! tstl d1 | check sign bit
- bpl 1f
- negl d1 | negate
- bchg #31,d1 | toggle sign bit
- ! 1:
- tstl d0 | check sign bit
- bpl 2f
- negl d0 | negate
- bchg #31,d0 | toggle sign bit
- ! 2:
- ! cmpl d1,d0
- ! blt lt
- ! bgt gt
- ! eq:
- ! clrl d0
- rts
- ! lt:
- ! moveq #-1,d0
- rts
- ! gt:
- ! moveq #1,d0
- rts
- --- 1,135 ----
- | single floating point compare routine
- |
- ! | written by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- ! | Based on a 68k floating point packet from Kai-Uwe Bloem, itself based
- ! | on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- ! |
- ! | Revision 2.0: olaf 12-92.
- |
-
- .text
- .even
- + .globl ___eqsf2, ___nesf2
- + .globl ___gtsf2, ___lesf2
- + .globl ___gesf2, ___ltsf2
- + | additional entry points for gcc 1.X
- .globl __cmpsf2, ___cmpsf2
-
- __cmpsf2:
- ___cmpsf2:
- ___eqsf2:
- ___nesf2:
- + moveml sp@(4),d0-d1 | get numbers to compare with
- + tstl d0 | check sign bit
- + bpl 1f
- + negl d0
- + bchg #31,d0 | toggle sign bit
- +
- + 1: tstl d1 | check sign bit
- + bpl 2f
- + negl d1 | negate
- + bchg #31,d1 | toggle sign bit
- +
- + 2: cmpl d1,d0
- + bne 4f
- + bclr #31,d1
- + cmpl #0x7f800000,d1 | NaN is not equal NaN !
- + bgt 4f
- + clrl d0
- + rts
- +
- + 4: moveql #1,d0
- + rts
- +
- ___gtsf2:
- ! moveml sp@(4),d0-d1 | get numbers to compare with
- ! tstl d0 | check sign bit
- bpl 1f
- + negl d0 | negate
- + bchg #31,d0 | toggle sign bit
- +
- + 1: tstl d1 | check sign bit
- + bpl 2f
- negl d1 | negate
- bchg #31,d1 | toggle sign bit
- !
- ! 2: cmpl d1,d0
- ! bgt 4f | d0 > d1 Test if NaN (should be false!)
- ! 3: clrl d0 | Test is false.
- ! rts
- !
- ! 4: bclr #31,d0
- ! cmpl #0x7f800000,d0 | First operand == NaN =?
- ! bgt 3b
- ! moveql #1,d0 | Test True
- ! rts
- !
- ! ___lesf2:
- ! moveml sp@(4),d0-d1 | get numbers to compare with
- tstl d0 | check sign bit
- + bpl 1f
- + negl d0 | negate
- + bchg #31,d0 | toggle sign bit
- +
- + 1: tstl d1 | check sign bit
- bpl 2f
- + negl d1 | negate
- + bchg #31,d1 | toggle sign bit
- +
- + 2: cmpl d1,d0
- + ble 4f
- + 3: moveql #1,d0 | Test is false
- + rts
- + 4: bclr #31,d0
- + cmpl #0x7f800000,d0 | First operand == NaN =?
- + bgt 3b
- + clrl d0 | Test true
- + rts
- +
- + ___gesf2:
- + moveml sp@(4),d0-d1 | get numbers to compare with
- + tstl d0 | check sign bit
- + bpl 1f
- negl d0 | negate
- bchg #31,d0 | toggle sign bit
- !
- ! 1: tstl d1 | check sign bit
- ! bpl 2f
- ! negl d1 | negate
- ! bchg #31,d1 | toggle sign bit
- !
- ! 2: cmpl d1,d0
- ! bge 4f
- ! 3: moveql #-1,d0 | False
- rts
- !
- ! 4: bclr #31,d0
- ! cmpl #0x7f800000,d0 | First operand == NaN =?
- ! bgt 3b
- ! clrl d0 | Test True
- ! rts
- !
- ! ___ltsf2:
- ! moveml sp@(4),d0-d1 | get numbers to compare with
- ! tstl d0 | check sign bit
- ! bpl 1f
- ! negl d0 | negate
- ! bchg #31,d0 | toggle sign bit
- !
- ! 1: tstl d1 | check sign bit
- ! bpl 2f
- ! negl d1 | negate
- ! bchg #31,d1 | toggle sign bit
- !
- ! 2: cmpl d1,d0
- ! blt 4f
- ! 3: clrl d0
- rts
- ! 4: bclr #31,d0
- ! cmpl #0x7f800000,d0 | First operand == NaN =?
- ! bgt 3b
- ! 5: moveql #-1,d0 | Test True
- rts
- +
- +
- +
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_divsf3.cpp,v
- retrieving revision 1.3
- diff -c -r1.3 _divsf3.cpp
- *** 1.3 1992/12/18 16:35:40
- --- _divsf3.cpp 1993/01/13 14:30:38
- ***************
- *** 45,50 ****
- --- 45,54 ----
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- |
- + | Revision 1.2.2 olaf 12-92
- + | + added support for NaN and Infinites
- + | + added support for -0
- + |
- | Revision 1.2.1 olaf 11-92
- | + prevent the tie rounding case if dividing is not exact.
- | > paranoia now says: "Division appears to round correctly"
- ***************
- *** 78,84 ****
- andw #0xff,d1 | kill sign bit
-
- andl #0x7fffff,d4 | remove exponent from u.mantissa
- ! tstw d0 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x800000,d4 | restore implied leading "1"
- bra 1f
- --- 82,150 ----
- andw #0xff,d1 | kill sign bit
-
- andl #0x7fffff,d4 | remove exponent from u.mantissa
- ! andl #0x7fffff,d5 | remove exponent from v.mantissa
- ! |
- ! |
- ! |
- ! cmpb #0xff,d0
- ! beq 0f |u == NaN || u== Inf
- ! cmpb #0xff,d1
- ! beq 1f | v == NaN || v == Inf
- ! tstb d0
- ! bne 3f | u not zero nor denorm
- ! tstl d4
- ! beq 2f | 0/ ?
- !
- ! 3: tstw d1
- ! bne nospec
- !
- ! tstl d5
- ! bne nospec
- ! bra retinf | x/0 -> +/- Inf
- !
- ! 0: tstl d4 | u == NaN ?
- ! bne retnan | NaN/ x
- ! cmpb #0xff,d1
- ! beq retnan | Inf/Inf or Inf/NaN
- ! bra retinf | Inf/x | x != Inf && x != NaN
- !
- ! 1: tstl d5
- ! bne retnan | x/NaN
- ! bra retzero | x/Inf -> +/- 0
- !
- ! 2: tstw d1
- ! bne retzero | 0/x ->+/- 0
- ! tstl d4
- ! bne retzero | 0/x
- ! bra retnan | 0/0
- ! |
- ! | Return Infinity with correct sign
- ! |
- ! retinf: tstl d2
- ! bpl 0f
- ! movel #0xff800000,d0
- ! return: moveml sp@+,d2-d5
- ! rts
- !
- ! 0: movel #0x7f800000,d0
- ! bra return
- ! |
- ! | Return NaN
- ! |
- ! retnan: movel #0x7fffffff,d0
- ! bra return
- ! |
- ! | Return correct signed zero
- ! |
- ! retzero:clrl d0 | zero destination
- ! tstl d2
- ! bmi return
- ! bset #31,d0
- ! bra return
- ! |
- ! | End of special handling
- ! |
- ! nospec: tstw d0 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x800000,d4 | restore implied leading "1"
- bra 1f
- ***************
- *** 89,95 ****
- beq retz | dividing zero
- # endif ERROR_CHECK
-
- - andl #0x7fffff,d5 | remove exponent from v.mantissa
- tstw d1 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x800000,d5 | restore implied leading "1"
- --- 155,160 ----
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_extends.cpp,v
- retrieving revision 1.2
- diff -c -r1.2 _extends.cpp
- *** 1.2 1992/10/09 20:35:29
- --- _extends.cpp 1993/01/13 14:30:40
- ***************
- *** 35,43 ****
- movew d0,d2 | extract sign
- lsrw #7,d0
- andw #0xff,d0 | kill sign bit (exponent is 8 bits)
- -
- andl #0x7fffff,d4 | remove exponent from mantissa
- ! tstw d0 | check for zero exponent - no leading "1"
- beq 0f | for denormalized numbers
- orl #0x800000,d4 | restore implied leading "1"
- bra 1f
- --- 35,60 ----
- movew d0,d2 | extract sign
- lsrw #7,d0
- andw #0xff,d0 | kill sign bit (exponent is 8 bits)
- andl #0x7fffff,d4 | remove exponent from mantissa
- !
- ! cmpb #0xff,d0
- ! bne nospec
- ! tstl d4
- ! beq retinf
- ! | ret nan
- ! movel #0x7fffffff,d0
- ! moveql #-1,d1
- ! return: moveml sp@+,d2-d7
- ! rts
- ! retinf: clrl d1
- ! movel #0x7ff00000,d0
- ! tstw d2
- ! bpl return
- ! bset #31,d0
- ! bra return
- !
- !
- ! nospec: tstw d0 | check for zero exponent - no leading "1"
- beq 0f | for denormalized numbers
- orl #0x800000,d4 | restore implied leading "1"
- bra 1f
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_mulsf3.cpp,v
- retrieving revision 1.2
- diff -c -r1.2 _mulsf3.cpp
- *** 1.2 1992/10/09 20:35:29
- --- _mulsf3.cpp 1993/01/13 14:30:42
- ***************
- *** 45,51 ****
- --- 45,55 ----
- |
- | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- + | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- |
- + | Revision 1.2.1 olaf 12-92:
- + | + added support for NaN and Infinites
- + | + added support for -0
- |
- | Revision 1.2, kub 01-90 :
- | added support for denormalized numbers
- ***************
- *** 62,69 ****
- lea sp@(4),a0
- moveml d2-d5,sp@-
- moveml a0@,d4/d5 | d4 = v, d5 = u
- - subw #8,sp | multiplication accumulator
-
- movel d5,d0 | d0 = u.exp
- swap d0
- movew d0,d2 | d2 = u.sign
- --- 66,73 ----
- lea sp@(4),a0
- moveml d2-d5,sp@-
- moveml a0@,d4/d5 | d4 = v, d5 = u
-
- +
- movel d5,d0 | d0 = u.exp
- swap d0
- movew d0,d2 | d2 = u.sign
- ***************
- *** 77,82 ****
- --- 81,131 ----
- andw #0xff,d1 | kill sign bit
-
- andl #0x7fffff,d5 | remove exponent from u.mantissa
- + andl #0x7fffff,d4 | remove exponent from v.mantissa
- + |
- + | Testing for NaN and Infinities
- + |
- + cmpb #0xff,d0
- + beq 0f
- + cmpb #0xff,d1
- + bne nospec
- + bra 1f
- + | first operand is special
- + | Nan?
- + 0: tstl d5
- + bne retnan
- + | Test v==0.
- + tstb d1
- + bne retinf | Inf * x == Inf
- + tstl d4
- + beq retnan | Inf * 0 == NaN
- +
- + retinf: tstl d2
- + bpl 0f
- + movel #0xff800000,d0
- + return: moveml sp@+,d2-d5
- + rts
- +
- +
- + 0: movel #0x7f800000,d0
- + bra return
- +
- + retnan: movel #0x7fffffff,d0
- + bra return
- + |
- + | v is special
- + |
- + 1: tstl d4
- + bne retnan
- + tstb d0
- + bne retinf
- + tstl d5
- + beq retnan
- + bra retinf
- + |
- + | end of NaN and Inf.
- + |
- + nospec: subw #8,sp | multiplication accumulator
- tstw d0 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x800000,d5 | restore implied leading "1"
- ***************
- *** 85,91 ****
- 1: tstl d5
- beq retz | multiplying zero
-
- - andl #0x7fffff,d4 | remove exponent from v.mantissa
- tstw d1 | check for zero exponent - no leading "1"
- beq 0f
- orl #0x800000,d4 | restore implied leading "1"
- --- 134,139 ----
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_negsf2.s,v
- retrieving revision 1.2
- diff -c -r1.2 _negsf2.s
- *** 1.2 1992/10/09 20:35:29
- --- _negsf2.s 1993/01/13 14:30:45
- ***************
- *** 2,8 ****
- --- 2,12 ----
- |
- | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- + | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- |
- + | revision 1.1.1, olaf 12-92
- + | + Since sign of NaN is ignored, we can flip it.
- + | + -0. is different from 0., but compares equal!
- |
- | Revision 1.1, kub 12-89 :
- | Created single float version for 68000
- ***************
- *** 16,22 ****
-
- __negsf2: | floating point negate
- ___negsf2:
- ! movel sp@(4),d0 | do not negate if operand is 0.0
- ! beq 0f
- bchg #31,d0 | flip sign bit
- ! 0: rts
- --- 20,25 ----
-
- __negsf2: | floating point negate
- ___negsf2:
- ! movel sp@(4),d0
- bchg #31,d0 | flip sign bit
- ! rts
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_normsf.cpp,v
- retrieving revision 1.4
- diff -c -r1.4 _normsf.cpp
- *** 1.4 1992/12/18 16:35:41
- --- _normsf.cpp 1993/01/13 14:30:49
- ***************
- *** 9,14 ****
- --- 9,17 ----
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
- |
- + | Revision 1.4.3 olaf 12-92:
- + | + added support for -0.
- + |
- | Revision 1.4.2 olaf 11-92
- | + correct stack after overflow.
- |
- ***************
- *** 130,136 ****
- retz: moveq #ERANGE,d0
- Emove d0,Errno
- clrl d0
- ! moveml sp@+,d2-d5
- rts
-
- oflow:
- --- 133,142 ----
- retz: moveq #ERANGE,d0
- Emove d0,Errno
- clrl d0
- ! tstw d2
- ! bpl 0f | -0
- ! bset #31,d0
- ! 0: moveml sp@+,d2-d5
- rts
-
- oflow:
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/access.c,v
- retrieving revision 1.9
- diff -c -r1.9 access.c
- *** 1.9 1992/09/14 14:56:40
- --- access.c 1993/02/22 06:15:11
- ***************
- *** 20,29 ****
- if (mode == F_OK)
- return 0; /* existence test succeeded */
-
- /* somewhat crufty code -- relies on R_OK, etc. matching the bits in the
- file mode, but what the heck, we can do this
- */
- ! if (__mint < 9 || ( geteuid() == sb.st_uid ) ) {
- if ( ((sb.st_mode >> 6) & mode) == mode )
- return 0;
- else
- --- 20,31 ----
- if (mode == F_OK)
- return 0; /* existence test succeeded */
-
- + if (getuid() == 0) return 0; /* super user can access anything */
- +
- /* somewhat crufty code -- relies on R_OK, etc. matching the bits in the
- file mode, but what the heck, we can do this
- */
- ! if (__mint < 9 || ( getuid() == sb.st_uid ) ) {
- if ( ((sb.st_mode >> 6) & mode) == mode )
- return 0;
- else
- ***************
- *** 30,36 ****
- goto accdn;
- }
-
- ! if ( getegid() == sb.st_gid ) {
- if ( ((sb.st_mode >> 3) & mode) == mode )
- return 0;
- else
- --- 32,38 ----
- goto accdn;
- }
-
- ! if ( getgid() == sb.st_gid ) {
- if ( ((sb.st_mode >> 3) & mode) == mode )
- return 0;
- else
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/alloca.cpp,v
- retrieving revision 1.7
- diff -c -r1.7 alloca.cpp
- *** 1.7 1992/10/09 20:35:29
- --- alloca.cpp 1993/02/18 00:00:06
- ***************
- *** 1,9 ****
- ! #APP
- ! #
- ! # alloca(nbytes) allocate junk in stack frame
- ! #
- ! # void *alloca(size_t size)
- ! #
-
- .text
- .even
- --- 1,8 ----
- ! |
- ! | alloca(nbytes) allocate junk in stack frame
- ! |
- ! | void *alloca(size_t size)
- ! |
-
- .text
- .even
- ***************
- *** 11,17 ****
- --- 10,21 ----
- .globl _alloca
- _alloca:
- movel sp@+,a0 | get return addr
- + #ifndef __SOZOBON__
- movel sp@+,d0 | get size -- assist in bug fix, add 4 to sp
- + #else
- + clrl d0 | this size_t thing is getting to be
- + movew sp@+,d0 | an annoyance... -- sb
- + #endif
-
- addql #1,d0 | ensure address even
- bclr #0,d0 | lop off odd bit
- ***************
- *** 19,24 ****
- --- 23,32 ----
- subl d0,sp | increase stack frame size by that much
- movel sp,d0 | set up to return it
-
- + #ifndef __SOZOBON__
- lea sp@(-4),sp | new top of stack (real bug fix here)
- + #else
- + lea sp@(-2),sp | hope this is correct... -- sb
- + #endif
-
- jmp a0@ | return by jmping via saved addr
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/atof.c,v
- retrieving revision 1.23
- diff -c -r1.23 atof.c
- *** 1.23 1992/10/09 20:35:29
- --- atof.c 1993/01/13 14:30:52
- ***************
- *** 29,34 ****
- --- 29,37 ----
- * thanks peter!
- *
- * mjr: 68881 version added
- + *
- + * schwab: 68881 version replaced with new implementation that
- + * uses fmovep for maximum precision, no bits lost anymore!
- */
-
- #if !defined (__M68881__) && !defined (sfp004)
- ***************
- *** 451,728 ****
- }
- #endif /* __OLD__ */
-
- ! #else __M68881__ || sfp004
- !
- ! #if 0
- ! #ifndef sfp004
- ! # define _M68881 /* use the predefined inline functions */
- ! #endif sfp004
- ! #endif 0
- !
- ! /* M.R's kludgy atof --- 881 version. */
- ! /* uses long integer accumulators and extended precision to put them */
- ! /* together in the fpu. The conversion long to extended is done completely */
- ! /* on the 881. */
- ! /* using extended precision in _float_ avoids rounding errors. */
- !
- ! /* 12.7.1989, 11.10.90, 28.1.91, 24.11.91 */
- ! /* On overflow, only +-infinity is returned (the 68881's default). */
- ! /* 24.11.91: return +-MAXDOUBLE instead of +- INFINITY or NAN */
- ! /* set errno to ERANGE/EDOM */
- !
- ! # include <ctype.h>
- ! # include <stdio.h>
- ! # include <float.h>
- ! # include <math.h>
- ! # include <errno.h>
- ! # include "flonum.h"
- !
- ! double atof( const char * );
- ! double strtod( const char *, const char ** );
- ! double _Float_( long, long, long, long );
- !
- ! # define true 1
- ! # define false 0
- ! # define CharIsDigit ( isdigit(*Text) )
- ! # define Digit ((*Text-'0'))
- !
- ! #if 0
- ! static unsigned long
- ! __notanumber[2] = { 0x7fffffffL, 0xffffffffL }; /* ieee NAN */
- ! # define NAN (*((double *)&__notanumber[0]))
- ! # endif 0
- !
- ! # define ten_mul(X) ((((X) << 2) + (X)) << 1)
-
- ! double strtod( const char * Save, const char ** Endptr )
- ! {
- ! register int Count; int Negative = false, ExpNegative = false;
-
- ! double Value;
- ! union double_di * l_Value;
- ! register long Exponent, Exp_Temp;
- ! register long Value_1, Value_2;
- ! register char c;
- ! register char * Text;
- ! register char * Places;
- ! char Buffer[15];
- !
- ! l_Value = (union double_di *) &Value;
- !
- ! Text = Save;
- ! Places = Buffer;
- !
- ! /* skip over leading whitespace */
- ! while (isspace(*Text)) Text++;
- !
- ! if (*Text == '-') {
- ! Negative = true;
- ! Text++;
- ! } else
- ! if (*Text == '+') {
- ! Negative = false;
- ! Text++;
- ! } else
- ! if( *Text == 0 ) {
- ! if( Endptr != NULL ) *Endptr = Text;
- ! return 0.0;
- ! }
- !
- ! /* Process the 'f'-part */
- ! /* ignore any digit beyond the 15th */
- ! /* BUG: may overflow if more than 10 digits precede the '.' */
- ! /* to cure use to accumulators as is being done for the digits after */
- ! /* the '.'. */
- !
- ! Exp_Temp = 0; /* needed later on for the exponential part */
- ! Value_1 = 0; Value_2 = 0; Count = 0; Exponent = 0;
- ! while( CharIsDigit ) { /* process digits before '.' */
- ! if( Count < 15 ) {
- ! Count++;
- ! *Places++ = Digit;
- ! }
- ! Text++;
- ! }
- ! if ( *Text == '.') {
- ! Text++;
- ! while( CharIsDigit ) { /* process digits after '.' */
- ! if( Count < 15 ) {
- ! Count++;
- ! *Places++ = Digit;
- ! Exponent--;
- ! }
- ! Text++;
- ! }
- ! }
- ! Places = Buffer;
- !
- ! /* Now, Places points to a vector of <= 15 digits */
- ! /* text points to the position immediately after the end of the mantissa */
- ! /* Value_2 will contain the equiv. of the 8 least significant digits, while */
- ! /* Value_1 will contain the equiv. of the 7 most significant digits (if any) */
- ! /* and therefore has to be multiplied by 10^8 */
- ! /* no overflow possible in the temporary buffers */
- !
- ! while( Count > 8 ) {
- ! Value_1 = ten_mul( Value_1 ); Value_1 += *Places++;
- ! Count--;
- ! }
- ! while( Count > 0 ) {
- ! Value_2 = ten_mul( Value_2 ); Value_2 += *Places++;
- ! Count--;
- ! }
- !
- ! /* 'e'-Part */
- ! if ( *Text == 'e' || *Text == 'E' || *Text == 'd' || *Text == 'D' ) {
- !
- ! char * Tail = Text;
- ! Text++;
- !
- ! /* skip over whitespace since ANSI allows space after e|E|d|D */
- ! while (isspace(*Text)) Text++;
- !
- ! if ( * Text == '-' ) {
- ! ExpNegative = true;
- ! Text++;
- ! } else
- ! if( * Text == '+' ) {
- ! ExpNegative = false;
- ! Text++;
- ! }
- ! if( !CharIsDigit ) {
- ! *Endptr = Tail; /* take the 'e|E|d|D' as part of the characters */
- ! goto Ende; /* following the number */
- ! } else {
- ! /* Exponents may have at most 3 digits, everything beyond this will be */
- ! /* silently ignored */
- ! Count = 0;
- ! while( CharIsDigit && (Count < 3) ) {
- ! Exp_Temp = ten_mul( Exp_Temp ); Exp_Temp += Digit;
- ! Count++;
- ! Text++;
- ! }
- ! if( ExpNegative ) Exp_Temp = -Exp_Temp;
- ! Exponent += Exp_Temp;
- ! }
- ! }
- ! Value = _Float_( Value_1, Exponent+8L, Value_2, Exponent );
- !
- ! if( Endptr != NULL ) *Endptr = Text;
- ! if( (l_Value -> i[0]) >= 0x7ff00000U ) { /* INFINITY or NAN */
- ! fprintf(stderr," strtod: OVERFLOW error\n");
- ! errno = ERANGE;
- ! Value = DBL_MAX;
- ! }
-
- ! Ende:
- ! if( Negative ) {
- ! Value = -Value;
- ! }
- ! return( Value );
- !
- ! # if 0
- ! Error:
- ! fputs("\njunk number \"",stderr); fputs(Save,stderr);
- ! fputs("\" --- returning NAN\n",stderr);
- ! errno = ERANGE;
- ! if( Endptr != NULL ) *Endptr = Text;
- ! return(NAN); /* == Not A Number (NAN) */
- ! # endif
- ! }
-
- ! double atof( const char * Text )
- ! {
- ! return(strtod(Text,(char **)NULL));
- ! }
-
- ! /*
- ! * double _Float_( long Value_1, long Exponent_1, long Value_2, long Exponent_2 )
- ! *
- ! * merges the accumulators Value_1, Value_2 and the Exponent to a double
- ! * precision float
- ! * called by strtod()
- ! *
- ! * does all floating point computations with extended precision on the fpu
- ! */
-
- ! #endif __M68881__ || sfp004
-
- ! #ifdef __M68881__
- ! asm(
- ! ".even
- ! .text
- ! .globl __Float_
- ! __Float_:
- ! ftentoxl a7@(8),fp1 | load Exponent_1
- ! ftentoxl a7@(16),fp0 | load Exponent_2
- ! fmull a7@(12),fp0 | fmull Value_2 -> fp0
- ! fmull a7@(4),fp1 | fmull Value_1 -> fp1
- ! faddx fp0,fp1
- ! fmoved fp1,a7@- | fmoved fp1 -> d0/d1
- ! moveml a7@+,d0-d1
- ! rts
- ! ");
- ! #endif __M68881
- ! #ifdef sfp004
-
- ! asm("| mjr, 30.1.1991
- ! |
- ! | base = 0xfffa50
- ! | the fpu addresses are taken relativ to 'base':
- ! |
- ! | a0: fpu base address
- ! |
- !
- ! | waiting loop ...
- ! |
- ! | wait:
- ! | ww: cmpiw #0x8900,a0@(resp)
- ! | beq ww
- ! | is coded directly by
- ! | .long 0x0c688900, 0xfff067f8 (a0)
- ! | and
- ! | www: tst.w a0@(resp)
- ! | bmi.b www
- ! | is coded by
- ! | .word 0x4a68,0xfff0,0x6bfa | test
- ! |
- !
- ! comm = -6
- ! resp = -16
- ! zahl = 0
-
- ! .globl __Float_
- ! .even
- ! .text
- ! __Float_:
- ! lea 0xfffffa50:w,a0 | fpu address
-
- ! movew #0x4092,a0@(comm) | ftentoxl -> fp1
- ! .long 0x0c688900, 0xfff067f8
- ! movel a7@(8),a0@ | load Exponent_1
- !
- ! movew #0x4112,a0@(comm) | ftentoxl -> fp2
- ! .long 0x0c688900, 0xfff067f8
- ! movel a7@(16),a0@ | load Exponent_2
- !
- ! movew #0x4123,a0@(comm) | fmull Value_2 -> fp2
- ! .long 0x0c688900, 0xfff067f8
- ! movel a7@(12),a0@ | load Value_2
- !
- ! movew #0x40a3,a0@(comm) | fmull Value_1 -> fp1
- ! .long 0x0c688900, 0xfff067f8
- ! movel a7@(4),a0@ | load Value_1
-
- ! movew #0x08a2,a0@(comm) | faddx fp2 -> fp1
- ! .word 0x4a68,0xfff0,0x6bfa | test
-
- ! movew #0x7480,a0@(comm) | fmoved fp1 -> d0/d1
- ! .long 0x0c688900, 0xfff067f8
- ! movel a0@,d0
- ! movel a0@,d1
- ! rts
- ! ");
- ! #endif sfp004
-
- #ifdef TEST
- #if 0
- --- 454,670 ----
- }
- #endif /* __OLD__ */
-
- ! #else /* __M68881__ || sfp004 */
-
- ! #include <string.h>
- ! #include <ctype.h>
- ! #include <math.h>
- ! #include <float.h>
- ! #include <errno.h>
- ! #include "flonum.h"
-
- ! #ifdef sfp004
- ! /* Note: not tested -- schwab */
-
- ! /* static */ double Float __PROTO ((char *));
-
- ! asm ("
- ! comm = -6;
- ! resp = -16;
- ! .text
- ! .even
- ! _Float:
- ! lea 0xfffffa50:w,a0 | fpu address
- ! movel sp@(4),a1
- ! movew #0x4c00,a0@(comm) | fmovep -> fp0
- ! 1: cmpw #0x8900,a0@(resp)
- ! beq 1b
- ! movel a1@+,a0@ | load data
- ! movel a1@+,a0@
- ! movel a1@+,a0@
- !
- ! movew #0x7400,a0@(comm) | fmoved fp0 -> d0/d1
- ! 1: cmpw #0x8900,a0@(resp)
- ! beq 1b
- ! movel a0@,d0
- ! movel a0@,d1
- ! rts
- ! ");
- ! #endif
-
- ! /* Format of packed decimal (from left to right):
-
- ! 1 Bit: sign of mantissa
- ! 1 Bit: sign of exponent
- ! 2 Bits zero
- ! 12 Bits: three digits exponent
- ! 4 Bits unused, fourth (higher order) digit of exponent
- ! 8 Bits zero
- ! 68 Bits: 17 digits of mantissa, decimal point after first digit
- ! --------
- ! 96 Bits == 12 Bytes
-
- ! All digits in BCD format. */
-
- ! double
- ! strtod (const char *str, const char **endptr)
- ! {
- ! char packed_buf[12];
- ! char *p;
- ! int exponent, i, digits_seen;
- ! union double_di di;
- !
- ! if (endptr)
- ! *endptr = str;
- ! while (isspace (*str))
- ! str++;
- ! p = packed_buf;
- ! for (i = 0; i < sizeof (packed_buf); i++)
- ! *p++ = 0;
- ! if (*str == '-')
- ! {
- ! packed_buf[0] = 0x80;
- ! str++;
- ! }
- ! else if (*str == '+')
- ! str++;
- ! else if (*str == '\0')
- ! return 0.0;
- ! i = 0;
- ! exponent = -1;
- ! digits_seen = 0;
- ! p = packed_buf + 3;
- ! /* Ignore leading 0's. */
- ! while (*str == '0')
- ! {
- ! digits_seen++;
- ! str++;
- ! }
- ! while (isdigit (*str))
- ! {
- ! digits_seen++;
- ! if (i < 17)
- ! {
- ! if (i & 1)
- ! *p = (*str - '0') << 4;
- ! else
- ! *p++ |= *str - '0';
- ! i++;
- ! }
- ! exponent++;
- ! str++;
- ! }
- ! if (*str == '.')
- ! {
- ! str++;
- ! if (i == 0)
- ! {
- ! /* Skip leading 0's. */
- ! while (*str == '0')
- ! {
- ! digits_seen++;
- ! exponent--;
- ! str++;
- ! }
- ! }
- ! while (isdigit (*str))
- ! {
- ! digits_seen++;
- ! if (i < 17)
- ! {
- ! if (i++ & 1)
- ! *++p = (*str - '0') << 4;
- ! else
- ! *p |= *str - '0';
- ! }
- ! str++;
- ! }
- ! }
- ! /* Check that there were any digits. */
- ! if (!digits_seen)
- ! return 0.0;
-
- ! if (*str == 'e' || *str == 'E' || *str == 'd' || *str == 'D')
- ! {
- ! const char *eptr = str;
- ! int exp_given, exp_neg;
-
- ! str++;
- ! while (isspace (*str))
- ! str++;
- ! exp_neg = 0;
- ! if (*str == '-')
- ! {
- ! exp_neg = 1;
- ! str++;
- ! }
- ! else if (*str == '+')
- ! str++;
- ! if (!isdigit (*str))
- ! {
- ! str = eptr;
- ! goto convert;
- ! }
- ! while (*str == '0')
- ! str++;
- ! exp_given = 0;
- ! while (isdigit (*str) && exp_given < 900)
- ! {
- ! exp_given = exp_given * 10 + *str - '0';
- ! str++;
- ! }
- ! while (isdigit (*str))
- ! str++;
- ! if (exp_given >= 900)
- ! {
- ! /* Must be overflow/underflow. */
- ! if (endptr)
- ! *endptr = str;
- ! if (exp_neg)
- ! return 0.0;
- ! goto overflow;
- ! }
- ! if (exp_neg)
- ! exponent -= exp_given;
- ! else
- ! exponent += exp_given;
- ! }
- ! convert:
- ! if (endptr)
- ! *endptr = str;
- ! if (exponent < 0)
- ! {
- ! packed_buf[0] |= 0x40;
- ! exponent = -exponent;
- ! }
- ! packed_buf[1] = exponent % 10;
- ! packed_buf[1] |= ((exponent /= 10) % 10) << 4;
- ! packed_buf[0] |= exponent / 10 % 10;
- ! #ifdef sfp004
- ! di.d = Float (packed_buf);
- ! #else
- ! __asm ("fmovep %1,%0" : "=f" (di.d) : "m" (packed_buf[0]));
- ! #endif
- ! /* Check for overflow. */
- ! if ((di.i[0] & 0x7fffffff) >= 0x7ff00000)
- ! {
- ! overflow:
- ! errno = ERANGE;
- ! if (packed_buf[0] & 0x80)
- ! return -DBL_MAX;
- ! else
- ! return DBL_MAX;
- ! }
- ! return di.d;
- ! }
-
- ! double
- ! atof (const char *str)
- ! {
- ! return strtod (str, NULL);
- ! }
-
- ! #endif /* __M68881__ || sfp004 */
-
- #ifdef TEST
- #if 0
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/bcopy.cpp,v
- retrieving revision 1.7
- diff -c -r1.7 bcopy.cpp
- *** 1.7 1992/11/06 23:02:09
- --- bcopy.cpp 1993/02/18 00:00:08
- ***************
- *** 17,38 ****
- | returns dest
- | functions are aliased
-
- _memcpy:
- _memmove:
- movl sp@(4),a1 | dest
- movl sp@(8),a0 | src
- jra common | the rest is samea as bcopy
-
- | void bcopy( const void *src, void *dest, size_t length );
- ! | void lbcopy( const void *src, void *dest, size_t length );
- | return value not used (returns src)
- ! | functions are aliased
-
- _bcopy:
- __bcopy:
- movl sp@(4),a0 | src
- movl sp@(8),a1 | dest
- common: movl sp@(12),d0 | length
- jeq exit | length==0? (size_t)
-
- | a0 src, a1 dest, d0.l length
- --- 17,61 ----
- | returns dest
- | functions are aliased
-
- + #ifndef __SOZOBON__
- _memcpy:
- _memmove:
- movl sp@(4),a1 | dest
- movl sp@(8),a0 | src
- jra common | the rest is samea as bcopy
- + #else
- + | _bcopy() is the base function below; for memcpy(), memmove()
- + | and bcopy(), we have to sneak a size_t into an unsigned long first.
-
- + _memcpy:
- + _memmove:
- + movl sp@(4),a1 | dest
- + movl sp@(8),a0 | src
- + clrl d0 | here is the sneaky bit...
- + movw sp@(12),d0 | length
- + jra common2 | the rest is samea as bcopy
- +
- + _bcopy:
- + movl sp@(4),a0 | src
- + movl sp@(8),a1 | dest
- + clrl d0 | here is the sneaky bit...
- + movw sp@(12),d0 | length
- + jra common2 | the rest is samea as bcopy
- + #endif
- +
- | void bcopy( const void *src, void *dest, size_t length );
- ! | void _bcopy( const void *src, void *dest, unsigned long length );
- | return value not used (returns src)
- ! | functions are aliased (except for HSC -- sb)
-
- + #ifndef __SOZOBON__
- _bcopy:
- + #endif
- __bcopy:
- movl sp@(4),a0 | src
- movl sp@(8),a1 | dest
- common: movl sp@(12),d0 | length
- + common2:
- jeq exit | length==0? (size_t)
-
- | a0 src, a1 dest, d0.l length
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/bzero.cpp,v
- retrieving revision 1.3
- diff -c -r1.3 bzero.cpp
- *** 1.3 1992/11/06 23:02:09
- --- bzero.cpp 1993/02/18 00:00:10
- ***************
- *** 18,24 ****
- --- 18,29 ----
- movl sp@(4),a0 | dest
- #ifdef __MSHORT__
- movb sp@(9),d0 | value
- + # ifndef __SOZOBON__
- movl sp@(10),d1 | length
- + # else
- + clrl d1
- + movw sp@(10),d1 | length
- + # endif
- #else
- movb sp@(11),d0 | value
- movl sp@(12),d1 | length
- ***************
- *** 27,39 ****
- jra do_set
-
- | void bzero( void *dest, size_t length );
- ! | void _bzero( void *dest, size_t length );
- | return value not used (returns dest)
-
- _bzero:
- __bzero:
- movl sp@(4),a0 | dest
- movl sp@(8),d1 | length
- jeq exit | length==0? (size_t)
- clrb d0 | value
-
- --- 32,53 ----
- jra do_set
-
- | void bzero( void *dest, size_t length );
- ! | void _bzero( void *dest, unsigned long length );
- | return value not used (returns dest)
-
- + #ifdef __SOZOBON__
- _bzero:
- + movl sp@(4),a0 | dest
- + clrl d1
- + movw sp@(8),d1 | length
- + jra scommon
- + #else
- + _bzero:
- + #endif
- __bzero:
- movl sp@(4),a0 | dest
- movl sp@(8),d1 | length
- + scommon:
- jeq exit | length==0? (size_t)
- clrb d0 | value
-
- ***************
- *** 44,53 ****
-
- movw a0,d2 | test for alignment
- btst #0,d2 | odd ?
- ! jeq even
- movb d0,a0@- | set one byte, now we are even
- subql #1,d1
- ! even:
- movb d0,d2
- lslw #8,d0
- movb d2,d0
- --- 58,67 ----
-
- movw a0,d2 | test for alignment
- btst #0,d2 | odd ?
- ! jeq areeven
- movb d0,a0@- | set one byte, now we are even
- subql #1,d1
- ! areeven:
- movb d0,d2
- lslw #8,d0
- movb d2,d0
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/ctime.c,v
- retrieving revision 1.8
- diff -c -r1.8 ctime.c
- *** 1.8 1992/09/14 14:56:40
- --- ctime.c 1993/02/18 00:00:15
- ***************
- *** 37,44 ****
-
- #else
-
- static char *
- ! two_dig(char *buf, unsigned short num) {
- unsigned int rem;
-
- rem = num % 10;
- --- 37,49 ----
-
- #else
-
- + static char * two_dig __PROTO((char *buf, unsigned short num));
- +
- static char *
- ! two_dig(buf, num)
- ! char *buf;
- ! unsigned short num;
- ! {
- unsigned int rem;
-
- rem = num % 10;
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/doprnt.c,v
- retrieving revision 1.19
- diff -c -r1.19 doprnt.c
- *** 1.19 1992/11/08 00:02:47
- --- doprnt.c 1993/02/18 00:00:18
- ***************
- *** 22,27 ****
- --- 22,30 ----
- * mjr++
- * and for turbo C and the MiNT library
- * ++um,mh
- + * and special M68881 and sfp004 version of cvt() added that uses fmovep for
- + * maximum precision, no bits lost anymore!
- + * ++schwab
- */
-
- #ifndef __NO_FLOAT__
- ***************
- *** 82,92 ****
-
- #define PUTC(ch) if( fputc(ch, fp) == EOF ) return EOF;
-
- - #define ARG(basetype) \
- - _ulong = flags&LONGINT ? va_arg(argp, long basetype) : \
- - flags&SHORTINT ? (short basetype)va_arg(argp, short) : \
- - va_arg(argp, int)
-
- #define TEN_MUL(X) ((((X) << 2) + (X)) << 1)
-
- #define todigit(c) ((c) - '0')
- --- 85,102 ----
-
- #define PUTC(ch) if( fputc(ch, fp) == EOF ) return EOF;
-
-
- + #define ARG(signtag) \
- + _ulong = \
- + flags&LONGINT ? \
- + (unsigned long)va_arg(argp, signtag long) : \
- + (flags&SHORTINT ? \
- + (unsigned long)(signtag short)va_arg(argp, signtag int) : \
- + (unsigned long)va_arg(argp, signtag int))
- + /* shorts are always promoted to ints; thus, it's `va_arg(... int)'
- + * for `flags&SHORTINT'!
- + */
- +
- #define TEN_MUL(X) ((((X) << 2) + (X)) << 1)
-
- #define todigit(c) ((c) - '0')
- ***************
- *** 106,111 ****
- --- 116,126 ----
-
- #ifdef __FLOATS__
- # include "flonum.h"
- + #if defined (__M68881__) || defined (sfp004)
- + static char *exponent __PROTO ((char *, int, int));
- + static int _round __PROTO ((int, char *, char *, char *));
- + static int cvt __PROTO ((double, int, int, char *, int, char *));
- + #else
- # if __STDC__
- static char *exponent(char *, int, int);
- static char *_round(double, int *, char *, char *, int, char *);
- ***************
- *** 115,120 ****
- --- 130,136 ----
- static char *_round();
- static int cvt();
- # endif
- + #endif /* __M68881__ */
- #endif
-
- #if defined(__GNUC__) && (!defined(__NO_INLINE__))
- ***************
- *** 303,309 ****
- /*FALLTHROUGH*/
- case 'd':
- case 'i':
- ! ARG(int);
- if ((long)_ulong < 0) {
- _ulong = -_ulong;
- sign = '-';
- --- 319,325 ----
- /*FALLTHROUGH*/
- case 'd':
- case 'i':
- ! ARG(signed);
- if ((long)_ulong < 0) {
- _ulong = -_ulong;
- sign = '-';
- ***************
- *** 348,356 ****
- }
- else
- softsign = 0;
- /* mjr: check for +-INFINITY */
- ! if (((unsigned long)_dd.i[0] == INF_HI) &&
- ! ((unsigned long)_dd.i[1] == INF_LO))
- {
- t = buf;
- if(softsign == 0)
- --- 364,386 ----
- }
- else
- softsign = 0;
- + /* hyc: check for overflows ... */
- + if (((unsigned long)_dd.i[0] > INF_HI) ||
- + ((unsigned long)_dd.i[0] == INF_HI &&
- + (unsigned long)_dd.i[1] > INF_LO))
- + {
- + t = buf;
- + if(softsign == 0)
- + t = strcpy(t, "NaN");
- + else
- + t = strcpy(t, "-NaN");
- + size = strlen(t);
- + goto pforw;
- + }
- + else /* Not greater, see if equal to Inf */
- +
- /* mjr: check for +-INFINITY */
- ! if ((unsigned long)_dd.i[0] == INF_HI)
- {
- t = buf;
- if(softsign == 0)
- ***************
- *** 367,373 ****
- */
- *buf = '\0';
- size = cvt(_double, (int)prec, (int)flags, &softsign,
- ! *fmt, buf, buf + (int)sizeof(buf));
- if (softsign)
- sign = '-';
- t = *buf ? buf : buf + 1;
- --- 397,407 ----
- */
- *buf = '\0';
- size = cvt(_double, (int)prec, (int)flags, &softsign,
- ! *fmt, buf
- ! #if !defined (__M68881__) && !defined (sfp004)
- ! , buf + (int)sizeof(buf)
- ! #endif
- ! );
- if (softsign)
- sign = '-';
- t = *buf ? buf : buf + 1;
- ***************
- *** 512,517 ****
- --- 546,561 ----
- for (n = fieldsz; n < dprec; n++)
- PUTC('0');
-
- + #ifdef __FLOATS__
- + if (fpprec > 0)
- + {
- + /* the number without exponent */
- + n = size;
- + while (*t != 'e' && *t != 'E' && --n >= 0)
- + PUTC (*t++);
- + }
- + else
- + #endif
- /* the string or number proper */
- for (n = size; --n >= 0; )
- PUTC(*t++);
- ***************
- *** 518,523 ****
- --- 562,572 ----
- /* trailing f.p. zeroes */
- while (--fpprec >= 0)
- PUTC('0');
- + #ifdef __FLOATS__
- + /* exponent */
- + while (--n >= 0)
- + PUTC (*t++);
- + #endif
- /* left-adjusting padding (always blank) */
- if (flags & LADJUST)
- for (n = realsz; n < width; n++)
- ***************
- *** 536,541 ****
- --- 585,868 ----
- }
-
- #ifdef __FLOATS__
- + #if defined (__M68881__) || defined (sfp004)
- +
- + /* Format of packed decimal (from left to right):
- +
- + 1 Bit: sign of mantissa
- + 1 Bit: sign of exponent
- + 2 Bits zero
- + 12 Bits: three digits exponent
- + 4 Bits unused, fourth (higher order) digit of exponent
- + 8 Bits zero
- + 68 Bits: 17 digits of mantissa, decimal point after first digit
- + --------
- + 96 Bits == 12 Bytes
- +
- + All numbers in BCD format. */
- +
- + #ifdef sfp004
- + /* Note: not tested -- schwab */
- +
- + /* static */ void Format __PROTO ((double number, char *buf));
- +
- + asm ("
- + comm = -6;
- + resp = -16;
- + .text
- + .even
- + _Format:
- + lea 0xfffffa50:w,a0 | fpu address
- + lea sp@(4),a1 | argptr
- +
- + movew #0x5400,a0@(comm) | fmoved -> fp0
- + 1: cmpw #0x8900,a0@(resp)
- + beq 1b
- + movel a1@+,a0@
- + movel a1@+,a0@
- +
- + movel a1@,a1 | get buf
- + movew #0x6c11,a0@(comm) | fmovep fp0,a1@{#17}
- + 1: cmpw #0x8900,a0@(resp)
- + beq 1b
- + movel a0@,a1@+
- + movel a0@,a1@+
- + movel a0@,a1@+
- + rts
- + ");
- + #endif /* sfp004 */
- +
- + static int
- + cvt (number, prec, flags, signp, fmtch, startp)
- + double number;
- + int prec, flags, fmtch;
- + char *signp, *startp;
- + {
- + char buf[12];
- + char digits[18];
- + int i;
- + char *p, *t;
- + int expcnt;
- + int gformat = 0, dotrim;
- +
- + /* Convert to packed decimal. */
- + #ifdef sfp004
- + Format (number, buf);
- + #else
- + asm volatile ("fmovep %0,%1{#17}" : : "f" (number), "m" (buf[0]));
- + #endif
- + /* Unpack it. */
- + p = buf + 3;
- + for (i = 0; i < 17; i++)
- + digits[i] = ((i & 1 ? *p >> 4 : *p++) & 15) + '0';
- + digits[i] = 0;
- + expcnt = ((buf[0] & 15) * 10 + ((buf[1] >> 4) & 15)) * 10 + (buf[1] & 15);
- + if (buf[0] & 0x40)
- + expcnt = -expcnt;
- + t = ++startp;
- + p = digits;
- + switch (fmtch)
- + {
- + case 'f':
- + if (expcnt >= 0)
- + {
- + *t++ = *p++;
- + while (expcnt > 0 && *p)
- + {
- + *t++ = *p++;
- + expcnt--;
- + }
- + while (expcnt > 0)
- + {
- + *t++ = '0';
- + expcnt--;
- + }
- + }
- + else
- + {
- + /* Note: decimal point after the first digit. */
- + expcnt++;
- + *t++ = '0';
- + }
- + if (prec || flags & ALT)
- + *t++ = '.';
- + while (prec > 0 && expcnt < 0)
- + {
- + *t++ = '0';
- + prec--;
- + expcnt++;
- + }
- + while (prec > 0 && *p)
- + {
- + *t++ = *p++;
- + prec--;
- + }
- + if (*p)
- + if (_round (*p, startp, t - 1, signp))
- + *--startp = '1';
- + while (prec > 0)
- + {
- + *t++ = '0';
- + prec--;
- + }
- + break;
- +
- + case 'e':
- + case 'E':
- + eformat:
- + *t++ = *p++;
- + if (prec || flags & ALT)
- + *t++ = '.';
- + while (prec > 0 && *p)
- + {
- + *t++ = *p++;
- + prec--;
- + }
- + if (*p)
- + if (_round (*p, startp, t - 1, signp))
- + {
- + expcnt++;
- + *startp = '1';
- + }
- + if (!gformat || flags & ALT)
- + {
- + while (prec > 0)
- + {
- + *t++ = '0';
- + prec--;
- + }
- + }
- + else
- + {
- + /* Suppress trailing zero's. */
- + while (t > startp && t[-1] == '0')
- + t--;
- + if (t[-1] == '.')
- + t--;
- + }
- + t = exponent (t, expcnt, fmtch);
- + break;
- +
- + case 'g':
- + case 'G':
- + if (prec == 0)
- + prec++;
- + /* If the exponent is not less than the precision or less than -4,
- + use 'e' format, otherwise use 'f' format. */
- + if (expcnt >= prec || expcnt < -4)
- + {
- + /* Count the significant digit before the decimal point. */
- + prec--;
- + /* 'g'/'G' -> 'e'/'E' */
- + fmtch -= 2;
- + gformat = 1;
- + goto eformat;
- + }
- + /* Like 'f', but prec counts significant digits. */
- + if (expcnt >= 0)
- + {
- + *t++ = *p++;
- + prec--;
- + /* Note that prec >= expcnt */
- + while (expcnt > 0 && *p)
- + {
- + *t++ = *p++;
- + expcnt--;
- + prec--;
- + }
- + while (expcnt > 0)
- + {
- + *t++ = '0';
- + expcnt--;
- + prec--;
- + }
- + }
- + else
- + {
- + *t++ = '0';
- + expcnt++;
- + }
- + if (prec > 0 || flags & ALT)
- + {
- + dotrim = 1;
- + *t++ = '.';
- + }
- + else
- + dotrim = 0;
- + if (prec > 0)
- + /* Pad with 0's */
- + while (expcnt < 0)
- + {
- + *t++ = '0';
- + expcnt++;
- + }
- + /* While more precision required and digits left */
- + while (prec > 0 && *p)
- + {
- + *t++ = *p++;
- + prec--;
- + }
- + if (*p)
- + if (_round (*p, startp, t - 1, signp))
- + /* Overflow, e.g. 9.999 -> 10.000 */
- + *--startp = '1';
- + if (flags & ALT)
- + {
- + while (prec > 0)
- + {
- + *t++ = '0';
- + prec--;
- + }
- + }
- + else if (dotrim)
- + {
- + /* Strip trailing 0's. */
- + while (t > startp && *--t == '0');
- + if (*t != '.')
- + t++;
- + }
- + break;
- + }
- + return (int) (t - startp);
- + }
- +
- + static int
- + _round (nxtdig, start, end, signp)
- + int nxtdig;
- + char *start, *end;
- + char *signp;
- + {
- + if (nxtdig > '4')
- + {
- + for (;; --end)
- + {
- + if (*end == '.')
- + --end;
- + if (++*end <= '9')
- + break;
- + *end = '0';
- + if (end == start)
- + /* Report overflow, caller must handle appropriately. */
- + return 1;
- + }
- + }
- + else if (*signp == '-')
- + {
- + for (;; --end)
- + {
- + if (*end == '.')
- + --end;
- + if (*end != '0')
- + break;
- + if (end == start)
- + *signp = 0;
- + }
- + }
- + return 0;
- + }
- +
- + #else /* !(__M68881__ || sfp004) */
- +
- static int
- cvt(number,prec,flags, signp, fmtch, startp, endp)
- double number;
- ***************
- *** 777,782 ****
- --- 1104,1111 ----
- return(start);
- }
-
- + #endif /* !(__M68881__ || sfp004) */
- +
- static char *
- exponent(p, exp, fmtch)
- register char *p;
- ***************
- *** 807,810 ****
- }
- return(p);
- }
- ! #endif __FLOATS__
- --- 1136,1139 ----
- }
- return(p);
- }
- ! #endif /* __FLOATS__ */
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/fflush.c,v
- retrieving revision 1.11
- diff -c -r1.11 fflush.c
- *** 1.11 1991/07/23 22:06:28
- --- fflush.c 1993/02/18 00:00:21
- ***************
- *** 44,50 ****
- return(0);
- f = fp->_flag;
- if (!(f & (_IORW | _IOREAD | _IOWRT))) /* file not open */
- ! return(0);
- if(fp->_cnt > 0) /* data in the buffer */
- {
- if(f & _IOWRT) /* writing */
- --- 44,50 ----
- return(0);
- f = fp->_flag;
- if (!(f & (_IORW | _IOREAD | _IOWRT))) /* file not open */
- ! return(EOF);
- if(fp->_cnt > 0) /* data in the buffer */
- {
- if(f & _IOWRT) /* writing */
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/fread.c,v
- retrieving revision 1.15
- diff -c -r1.15 fread.c
- *** 1.15 1992/12/18 16:35:48
- --- fread.c 1993/02/20 05:51:59
- ***************
- *** 120,125 ****
- --- 120,126 ----
- ptr = data + cnt;
- cnt -= ptr - data;
- n -= ptr - data;
- + l += ptr - data;
- data = ptr;
- while( cnt>0 ) {
- if( *ptr!='\r' ) {
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/getpass.c,v
- retrieving revision 1.2
- diff -c -r1.2 getpass.c
- *** 1.2 1992/10/09 20:35:29
- --- getpass.c 1993/02/22 06:15:12
- ***************
- *** 2,28 ****
- #include <stdio.h>
- #include <unistd.h>
- #include <string.h>
-
- char *
- getpass(prompt)
- const char *prompt;
- {
- ! static char buf[81];
- char *ret;
- struct sgttyb oldsb, newsb;
-
- fflush(stdin);
- ! gtty(0, &oldsb);
- newsb = oldsb;
- newsb.sg_flags &= ~ECHO;
- ! stty(0, &newsb);
- ! fputs(prompt, stderr); fflush(stderr);
- ! buf[0] = buf[81] = 0;
- ! if((ret = fgets(buf, 80, stdin)) != 0)
- {
- ! /* null terminate string */
- buf[strlen(buf) - 1] = 0;
- }
- ! stty(0, &oldsb);
- return ret;
- }
- --- 2,43 ----
- #include <stdio.h>
- #include <unistd.h>
- #include <string.h>
- + #include <limits.h>
-
- + extern int __mint;
- +
- char *
- getpass(prompt)
- const char *prompt;
- {
- ! static char buf[PASS_MAX + 1];
- char *ret;
- struct sgttyb oldsb, newsb;
- + FILE *tty;
- + int ttyfd = 0;
-
- fflush(stdin);
- ! tty = stdin;
- ! if (__mint) {
- ! if ((tty = fopen("U:\\DEV\\TTY", "r")) == NULL)
- ! return NULL;
- ! }
- ! ttyfd = fileno(tty);
- ! fflush(tty);
- ! gtty(ttyfd, &oldsb);
- newsb = oldsb;
- newsb.sg_flags &= ~ECHO;
- ! stty(ttyfd, &newsb);
- ! fputs(prompt, stderr);
- ! fflush(stderr);
- ! if ((ret = fgets(buf, PASS_MAX + 1, tty)) != 0)
- {
- ! /* zap the newline */
- ! if (buf[strlen(buf) - 1] == '\n')
- buf[strlen(buf) - 1] = 0;
- }
- ! stty(ttyfd, &oldsb);
- ! if (__mint)
- ! (void) fclose(tty);
- return ret;
- }
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/getuid.c,v
- retrieving revision 1.9
- diff -c -r1.9 getuid.c
- *** 1.9 1992/09/14 14:56:40
- --- getuid.c 1993/02/18 00:00:27
- ***************
- *** 28,34 ****
-
- if (__mint) {
- r = Psetuid(x);
- ! if (r) {
- errno = (int) -r;
- return -1;
- }
- --- 28,34 ----
-
- if (__mint) {
- r = Psetuid(x);
- ! if (r < 0) {
- errno = (int) -r;
- return -1;
- }
- ***************
- *** 45,51 ****
-
- if (__mint) {
- r = Psetgid(x);
- ! if (r) {
- errno = (int) -r;
- return -1;
- }
- --- 45,51 ----
-
- if (__mint) {
- r = Psetgid(x);
- ! if (r < 0) {
- errno = (int) -r;
- return -1;
- }
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/regexp.c,v
- retrieving revision 1.6
- diff -c -r1.6 regexp.c
- *** 1.6 1992/11/06 23:02:09
- --- regexp.c 1993/02/18 00:00:30
- ***************
- *** 32,38 ****
- #include <string.h>
- #include <regexp.h>
- #include <stdio.h>
- ! #include <sys/types.h>
- #ifndef _COMPILER_H
- #include <compiler.h>
- #endif
- --- 32,42 ----
- #include <string.h>
- #include <regexp.h>
- #include <stdio.h>
- ! #ifdef __TURBOC__
- ! # include <sys\types.h>
- ! #else
- ! # include <sys/types.h>
- ! #endif
- #ifndef _COMPILER_H
- #include <compiler.h>
- #endif
- ===================================================================
- RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/strlwr.c,v
- retrieving revision 1.1
- diff -c -r1.1 strlwr.c
- *** 1.1 1989/03/19 22:30:52
- --- strlwr.c 1993/02/18 00:00:32
- ***************
- *** 1,15 ****
- #include <ctype.h>
-
- char *strlwr(string)
- ! register char *string;
- ! {
- ! register char *p = string;
-
- ! while(*string)
- ! {
- ! if(isupper(*string))
- ! *string ^= 0x20;
- ! ++string;
- ! }
- ! return(p);
- ! }
- --- 1,18 ----
- #include <ctype.h>
-
- char *strlwr(string)
- ! register char *string;
- ! {
- ! register char *p = string;
-
- ! if(p)
- ! {
- ! while(*string)
- ! {
- ! if(isupper(*string))
- ! *string ^= 0x20;
- ! ++string;
- ! }
- ! }
- ! return(p);
- ! }
-